-
Notifications
You must be signed in to change notification settings - Fork 100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error functions in pure Julia form #82
base: master
Are you sure you want to change the base?
Conversation
…) in pure Julia form
Do also see the discussion in #52 |
ysquared = y^2 | ||
numerator = a[5]*ysquared | ||
denominator = ysquared | ||
for i in 1:3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should use the @horner
macro from Base, e.g. like https://github.com/JuliaLang/julia/blob/9ac2dfa09f0016c47fd14c0c2258a70274c19e69/base/special/trig.jl
@@ -3,10 +3,136 @@ | |||
using Base.Math: @horner, libm | |||
using Base.MPFR: ROUNDING_MODE | |||
|
|||
function ErrFunApprox(x::Float64,iserfc::Bool,result::Float64) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
||
xxbig = 27.2e+0 | ||
Maximum = 2.53e+307 | ||
_HUGE = 6.71e+7 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
explain why these constants
result = ysquared*(numerator+pp[5])/(denominator+qq[5]) | ||
result = (InvSqrtPI-result)/y | ||
ysquared = trunc(y*16.0)/16.0 | ||
del = (y-ysquared)*(y+ysquared) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a comment to explain what this is doing
function ErrFunApprox(x::Float64,iserfc::Bool,result::Float64) | ||
if isinf(x) | ||
if x > 0 | ||
return iserfc?0.0:1.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ternaries need spaces in 0.7, so this should be iserfc ? 0.0 : 1.0
Hello everyone, I'm a prospective applicant of GSoC this year, and I'm interested in developing error functions in pure Julia form as GSoC in julialang.org says.
Here I write some code of error functions in pure Julia form, which is adapted from https://github.com/simonbyrne/apple-libm. And it has passed tests. Hope you will find it's useful!
Let me have a brief self-introduction of myself. I'm now a senior year undergraduate student major in geophysics and dual major in computer science. And this year I will pursue my PhD degree in the United States. So I should have enough time and required background to do this project. Hope I could be chosen into the project!